
# This spec requires the extension to be installed in RETROSPECTIVA_ROOT/extensions
retro_root = File.expand_path(File.join(File.dirname(__FILE__), '../../..'))
unless File.exists?("#{retro_root}/lib/retrospectiva.rb") && File.exists?("#{retro_root}/extensions")
  puts "This extension must be in the extensions directory of a retrospectiva installation."
  exit 1
end

ENV["RAILS_ENV"] = "test"
require File.expand_path(File.join(File.dirname(__FILE__), "../../../config/environment"))
require 'application'

silence_warnings { RAILS_ENV = "test" }

module ActiveRecord
  module Associations
    class AssociationProxy
      def raise_on_type_mismatch(record)
        # do nothing
      end
    end
  end
end

=begin
class InvalidActionError < StandardError
end
class << ActiveRecord::Base
  def connection
    raise InvalidActionError, "access to a database is not allowed", caller
  end
end
=end